#include "StdAfx.h"
#include "GameCommand.h"

CGameCommand::CGameCommand()
{
	m_clientID = -1;
	m_actionType = ACTION_STOP;
	m_time = 0;
}

CGameCommand::CGameCommand(int clientID)
{
	m_clientID = clientID;
	m_actionType = ACTION_STOP;
	m_time = 0;
}

CGameCommand::~CGameCommand()
{
}

void CGameCommand::init(int time)
{
	m_time = time;
	m_actionType = ACTION_NOCHANGE;
}

void CGameCommand::stop()
{
	m_actionType = ACTION_STOP;
}

void CGameCommand::move(int x, int y)
{
	m_actionType = ACTION_MOVE;
	m_targetX = x;
	m_targetY = y;
}

void CGameCommand::attack(int targetID, int weaponID)
{
	m_actionType = ACTION_ATTACK;
	m_targetID = targetID;
	m_objectID = weaponID;
}

void CGameCommand::attack_aoe(int weaponID, int x, int y)
{
	m_actionType = ACTION_ATTACK_AOE;
	m_objectID = weaponID;
	m_targetX = x;
	m_targetY = y;
}

void CGameCommand::cast(int targetID, int spellID)
{
	m_actionType = ACTION_CAST;
	m_targetID = targetID;
	m_objectID = spellID;
}

void CGameCommand::cast_aoe(int spellID, int x, int y)
{
	m_actionType = ACTION_CAST;
	m_objectID = spellID;
	m_targetX = x;
	m_targetY = y;
}